import {BasicColumn, FormSchema} from '/@/components/Table';

export const columns: BasicColumn[] = [
  {
    title: '手机号',
    dataIndex: 'mobile',
    width: 120,
  },
  {
    title: '证件号',
    dataIndex: 'identityNo',
    width: 150,
  },
  {
    title: '描述',
    dataIndex: 'blackDesc',
    width: 200,
  },
  {
    title: '标记人',
    dataIndex: 'addAccountId',
    width: 120,
  },
  {
    title: '标记时间',
    dataIndex: 'addTime',
    width: 150,
  },
  {
    title: '来源',
    dataIndex: 'sourceType',
    width: 120,
  },
  {
    title: '是否启用',
    dataIndex: 'isEnable',
    width: 120,
  },
  {
    title: '移除人',
    dataIndex: 'removeAccountId',
    width: 120,
  },
  {
    title: '移除时间',
    dataIndex: 'removeTime',
    width: 150,
  },
  {
    title: '创建人',
    dataIndex: 'createUser',
    width: 120,
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
    width: 150,
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'mobile',
    label: '手机号',
    component: 'Input',
    colProps: {span: 5}
  },
  {
    field: 'identityNo',
    label: '证件号',
    component: 'Input',
    colProps: {span: 5}
  }
];

export const formSchema: FormSchema[] = [
  {
    label: 'Id',
    field: 'blacklistId',
    component: 'Input',
    required: false,
    show: false,
  },
  {
    label: '手机号',
    field: 'mobile',
    component: 'Input',
    rules: [{required: true, message: '请输入手机号'}, {pattern: /^1[3456789]\d{9}$/, message: '手机号码格式错误！'}],
  },
  {
    label: '证件号',
    field: 'identityNo',
    component: 'Input',
    required: true,
  },
  {
    label: '描述',
    field: 'blackDesc',
    component: 'Input',
    required: true,
  },
  {
    label: '来源',
    field: 'sourceType',
    component: 'Input',
    required: true,
  },
  {
    field: 'isEnable',
    label: '是否启用',
    component: 'RadioButtonGroup',
    defaultValue: 0,
    componentProps: {
      options: [
        {label: '启用', value: 0},
        {label: '禁用', value: 1},
      ]
    },
  }
];
